#include "SpotLight.h"
SpotLight::SpotLight(std::vector<float>position, std::string name, std::vector<float>ambient, std::vector<float>diffuse, std::vector<float>specular, float range, float spot, std::vector<float>attenuation) :
	Light("PointLight", position, name, ambient, diffuse, specular),
	m_range(range),
	m_spot(spot),
	m_attenuation(attenuation[0], attenuation[1], attenuation[2])
{
}
SpotLight::~SpotLight()
{
}
Light::SpotLightStructure SpotLight::GetLightStructure()
{
	SpotLightStructure result;
	result.ambient = GetAmbient();
	result.diffuse = GetDiffuse();
	result.specular = GetSpecular();
	result.position = m_transform->GetPosition();
	result.range = m_range;
	DirectX::XMFLOAT3 direction(1.0f, 0.0f, 0.0f);
	DirectX::XMVECTOR directionVector = DirectX::XMLoadFloat3(&direction);
	directionVector = DirectX::XMVector3Transform(directionVector, m_transform->GetLocalMatrix());
	result.direction = direction;
	result.spot = m_spot;
	result.attenuation = m_attenuation;
	return result;
}